package com.example.SolveRedundantCode_AOP.service;

import com.example.SolveRedundantCode.FTPClient;
import com.example.SolveRedundantCode.FtpProvider;
import com.example.SolveRedundantCode_AOP.aop.FtpOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * <pre>
 * 功能描述：
 * </pre>
 *
 * @author: 李明杰
 * @date: 2023/3/7 22:45
 */
@Slf4j
@Service
class FtpProviderImpl implements FtpProvider {

    @Resource
    private FTPClient ftpClient;

    @Override
    @FtpOperation
    public String[] listDirectories(String directory) throws IOException {
        return ftpClient.listDirectories(directory);
    }

    @Override
    @FtpOperation
    public boolean deleteFile(String filePath) throws IOException {
        return ftpClient.deleteFile(filePath);
    }
}
